create table TravelGuideCash
(
	 [TravelGuideCashId] int identity(1, 1) primary key
	,[TravelGuideId] int
	,[TravelGuidePriceId] int
	,[BeginDate] datetime
	,[EndDate] datetime
	,[CreatedBy] int
	,[CreatedDate] datetime
	,[UpdatedBy] int
	,[UpdatedDate] datetime
	,[Status] int 
)
go


CREATE PROCEDURE TravelGuideCashGet
	@TravelGuideCashId int
AS
SELECT *
FROM [TravelGuideCash]
WHERE [TravelGuideCash].[TravelGuideCashId] = @TravelGuideCashId
GO

CREATE PROCEDURE TravelGuideCashList
AS
SELECT *
FROM [TravelGuideCash]
ORDER BY TravelGuideCashId DESC
GO

CREATE PROCEDURE TravelGuideCashInsert
	@TravelGuideId int
	,@TravelGuidePriceId int
	,@BeginDate datetime
	,@EndDate datetime
	,@CreatedBy int
	,@CreatedDate datetime
	,@UpdatedBy int
	,@UpdatedDate datetime
	,@Status int
AS

INSERT INTO TravelGuideCash (
	 [TravelGuideId]
	,[TravelGuidePriceId]
	,[BeginDate]
	,[EndDate]
	,[CreatedBy]
	,[CreatedDate]
	,[UpdatedBy]
	,[UpdatedDate]
	,[Status]
	
) VALUES (
	 @TravelGuideId
	,@TravelGuidePriceId
	,@BeginDate
	,@EndDate
	,@CreatedBy
	,@CreatedDate
	,@UpdatedBy
	,@UpdatedDate
	,@Status
)

select SCOPE_IDENTITY()
GO

CREATE PROCEDURE TravelGuideCashUpdate
	@TravelGuideCashId int, 
	@TravelGuideId int, 
	@TravelGuidePriceId int, 
	@BeginDate datetime, 
	@EndDate datetime, 
	@CreatedBy int, 
	@CreatedDate datetime, 
	@UpdatedBy int, 
	@UpdatedDate datetime, 
	@Status int 

AS

UPDATE TravelGuideCash SET
	   [TravelGuideId] = @TravelGuideId
	   ,[TravelGuidePriceId] = @TravelGuidePriceId
	   ,[BeginDate] = @BeginDate
	   ,[EndDate] = @EndDate
	   ,[CreatedBy] = @CreatedBy
	   ,[CreatedDate] = @CreatedDate
	   ,[UpdatedBy] = @UpdatedBy
	   ,[UpdatedDate] = @UpdatedDate
	   ,[Status] = @Status
WHERE [TravelGuideCash].[TravelGuideCashId] = @TravelGuideCashId
GO

CREATE PROCEDURE TravelGuideCashDelete
	@TravelGuideCashId int  
AS
DELETE FROM TravelGuideCash
WHERE [TravelGuideCash].[TravelGuideCashId] = @TravelGuideCashId
GO